<template>
<div>
    <h3>MyHome组件</h3>
    <button type="button" class="btn btn-primary" @click="goToMovie(3)">导航到Movie页面</button>
</div>
</template>

<script>
export default{
    name:'MyHome',
    methods: {
        goToMovie(id){
            // 编程式导航
            this.$router.push('/movie/'+id);
        }
    },
}
</script>

<style lang="less" scoped></style>
